package smarthouse.ejb;

import java.util.List;

import javax.ejb.Remote;

import smarthouse.dto.UserDTO;

/**
 * @author Sergiu
 *
 */
@Remote
public interface UserDAORemote {

	/**
	 * User login
	 * 
	 * @param username
	 * @param password
	 * @return
	 */
	UserDTO login(String username, String password);

	/**
	 * Get all users from DB
	 * 
	 * @return
	 */
	List<UserDTO> getAllUsers();

	/**
	 * Get a user by Id
	 * 
	 * @param id
	 * @return
	 */
	UserDTO getUserbyId(int id);

	/**
	 * Update user information
	 * 
	 * @param user
	 * @return
	 */
	boolean updateUser(UserDTO user);

	/**
	 * Remove user by Id
	 * 
	 * @param id
	 * @return
	 */
	boolean removeUser(int id);

	/**
	 * Insert new User into DB
	 * 
	 * @param user
	 * @return
	 */
	boolean addUser(UserDTO user);

	/**
	 * Get the ID of the last user added
	 * 
	 * @return
	 */
	int getLastUserId();

}
